|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.mnstarfire.loaders3d.Inspector3DS
3DS File Analyzer / Loader
Copyright (c) 2000, 2001 Starfire Research - All Rights Reserved.
Last Modified: March 14, 2001
This is just a shell to make using "Loader3DS" easier
Usage:
// setup a file name "fname"
Inspector3DS loader = new Inspector3DS(fname);
loader.setLogging(true); // turns on writing a log file
loader.setDetail(7); // sets level of detail of report log
loader.setTextureLightingOn(); // turns on texture modulate mode
// loader.setTexturePath("D:\MyTextures"); // optional alternate path to find texture files
loader.parseIt();
TransformGroup max = loader.getModel();
Usage via URL:
// setup a URL "url"
// setup a string to the base of the url (directory of where to find textures)
Inspector3DS loader = new Inspector3DS(url);
loader.setURLBase(urlBase); // critical for loading textures
loader.setTextureLightingOn(); // turns on texture modulate mode
// loader.setTexturePath("D:\MyTextures"); // optional alternate path to find texture files
loader.parseIt();
TransformGroup max = loader.getModel();
Notes:
Picking capabilities are set for INTERSECT_COORD
Smoothing could be ignored to improve performance.
Java shininess is 1.0 to 128.0 (clamped), but 3DS is 0.0 to 1.0.
I'm mapping 3DS shininess (Max "Glossiness") to 0.0 to 128.0 (slightly wrong on low end)
Max "Specular Level" is 3DS "Shininess Strength" (SHIN2PCT)
Now supports URL loading
| Constructor Summary | |
Inspector3DS(java.lang.String filename)
Basic constructor - pass a file name (potentially including the path to the file) |
|
Inspector3DS(java.net.URL urlIn)
Basic constructor using a URL MUST be followed by setURLBase (so textures can be found) |
|
| Method Summary | |
javax.media.j3d.TransformGroup |
getModel()
This returns a TransformGroup with Shape3Ds as children representing the geometry (with materials applied). |
void |
parseIt()
Use this to process the 3DS file |
void |
setCreaseAngle(double ca)
Use this to adjust how "rounded" objects are Values are in radians from 0 to PI - default is 0.7679 |
void |
setDetail(int desiredDetail)
This controls the level of detail reported 0 = nothing 1-8 play around with this until you reach the level you desire 9 = everything |
void |
setLogging(boolean logging)
If true is passed then as the 3DS file is parsed a log file "log3ds.txt" will be created. |
void |
setTextureLightingOn()
This turns on Texture blending (so that textures get lighting effects) |
void |
setTexturePath(java.lang.String tdpath)
This allows you to set a different directory to load textures from. Useless if loading from a URL. If this is not set all textures are assumed to be in the same directory as the 3DS model |
void |
setURLBase(java.lang.String urlBase)
Where to find the texture files when using URL access |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Inspector3DS(java.lang.String filename)
public Inspector3DS(java.net.URL urlIn)
| Method Detail |
public void setURLBase(java.lang.String urlBase)
public void parseIt()
public javax.media.j3d.TransformGroup getModel()
public void setLogging(boolean logging)
public void setDetail(int desiredDetail)
public void setTextureLightingOn()
public void setTexturePath(java.lang.String tdpath)
public void setCreaseAngle(double ca)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||